<?php
/*
 * @Author: your name
 * @Date: 2020-12-23 12:01:16
 * @LastEditTime: 2020-12-28 10:12:01
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: /special/application/adminapiv3/controller/module_manage/hgshield/NormalRule.php
 */
namespace app\adminapiv3\controller;


class NormalRule extends BaseController
{
    /**
     * @name 列表
     * @param $host_id
     * @param $group_id
     * @author wx
     * @date 2019/11/12 14:34
     */
    public function list($host_id, $group_id)
    {
        $params['description'] = $this->filterInput('description', 'get');
        $params['status'] = $this->filterInput('status', 'get');
        $params['handle'] = $this->filterInput('handle', 'get');

        $server = new \app\adminapiv3\service\NormalRule();
        $list = $server->toDo('list',[$host_id, $group_id, $params]);

        $this->jsonOutPut($list);
    }

    /**
     * @name 开启
     * @author wx
     * @date 2019/11/12 14:54
     */
    public function open($host_id)
    {
        $id = $this->filterInput('id*','post');
        $params['status'] = $this->filterInput('status*', 'post');

        $server = new \app\adminapiv3\service\NormalRule();
        $server->toDo('modify',[$host_id, $id, $params]);

        $this->jsonOutPut([],true);
        $this->Async('Hgshield', 'rules');
    }

    /**
     * @name 停用
     * @author wx
     * @date 2019/11/12 14:55
     */
    public function close($host_id)
    {
        $id = $this->filterInput('id*','post');
        $params['status'] = $this->filterInput('status*', 'post');

        $server = new \app\adminapiv3\service\NormalRule();
        $server->toDo('modify',[$host_id, $id, $params]);

        $this->jsonOutPut([],true);
        $this->Async('Hgshield', 'rules');
    }

    /**
     * @name 配置
     * @author wx
     * @date 2019/11/12 14:56
     */
    public function setting($host_id)
    {
        $id = $this->filterInput('id*','post');
        $params['status'] = $this->filterInput('status*', 'post');
        $params['handle'] = $this->filterInput('handle*', 'post');

        $server = new \app\adminapiv3\service\NormalRule();
        $server->toDo('modify',[$host_id, $id, $params]);

        $this->jsonOutPut([],true);
        $this->Async('Hgshield', 'rules');
    }
}